<template>
  <!--单例模式，name相同则复用一个无界实例，改变url则子应用重新渲染实例到对应路由 -->
  <WujieVue width="100%"
            height="100%"
            :name="$route.meta.subapp.name"
            ref="wujie"
            :url="computedURL" />
</template>

<script>

export default {
  computed: {
    computedURL () {
      let index = this.$route.fullPath.indexOf('?')
      if (index != -1) {
        return `${this.$route.meta.subapp.host}/${this.$route.params.path}${this.$route.fullPath.substring(index)}`
      }
      return `${this.$route.meta.subapp.host}/${this.$route.params.path}`
    }
  }
}
</script>

<style lang="scss" scoped></style>
